package com.yihuier.yihuier.Service.Common;

import com.yihuier.yihuier.Mapper.Common.ServiceCheckMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class ServiceCheckService {

    @Autowired
    private ServiceCheckMapper serviceCheckMapper;

    public boolean isUserOfCompanyServiceValid(int user_id){
        //现在时间
        Date now = new Date();
        //公司服务到期时间
        Date  deadline = serviceCheckMapper.checkUsersCompanyService(user_id);
        //如果公司服务到期时间小于现在时间，返回false，公司服务到期时间大于现在时间则true。
        return now.getTime() < deadline.getTime();
    }


}
